---
title: Toggle
description: A two-state button that can be on or off.
author:
  name: imskyleen
  url: https://github.com/imskyleen
releaseDate: 2025-09-07
---

<ComponentPreview name="demo-components-base-toggle" />

## Installation

<ComponentInstallation name="components-base-toggle" />

## Usage

```tsx
<Toggle />
```

## API Reference

### Toggle

<div className="flex flex-col gap-2">
<ExternalLink
  href="https://animate-ui.com/docs/primitives/base/toggle#toggle"
  text="Animate UI API Reference - Toggle Primitive"
/>

<ExternalLink
  href="https://base-ui.com/react/components/toggle#api-reference"
  text="Base UI API Reference - Toggle"
/>
</div>

<TypeTable
  type={{
    variant: {
      description: 'The variant of the Toggle component.',
      type: '"default" | "outline"',
      required: false,
    },
    size: {
      description: 'The size of the Toggle component.',
      type: '"default" | "sm" | "lg" | "icon"',
      required: false,
    },
    '...props': {
      description: 'The props of the Toggle component.',
      type: 'HTMLMotionProps<"button">',
      required: false,
    },
  }}
/>

<Callout type="info">
  The `render` property is not supported in the `Toggle` component, as it is
  used for animation.
</Callout>

## Credits

- [Base UI Toggle](https://base-ui.com/react/components/toggle)
- Credit to [shadcn/ui](https://ui.shadcn.com/docs/components/toggle) for style inspiration.
